package ltd.newbee.mall.service;

import ltd.newbee.mall.entity.NewbeeMallPurchaseInfo;
import ltd.newbee.mall.util.PageResult;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;

import java.util.Optional;

/**
 * @ClassName: IPurchaseInfoService
 * @Description: 采购信息Service接口
 * @Author: Emily
 * @Date: 2022-09-03 15:02
 * @Version 1.0
 */
public interface IPurchaseInfoService
{
    /**
     * 通过采购单据id查询
     * @param purchaseId 采购单据id
     * @return
     */
    Optional<NewbeeMallPurchaseInfo> findById(String purchaseId);

    /**
     * 分页查询所有采购订单
     * @param pageable
     * @return
     */
    Page<NewbeeMallPurchaseInfo> findAll(Pageable pageable);


    /**
     * 通过供货商id分页查询采购订单
     * @param supplierId 供货商id
     * @return
     */
    Page<NewbeeMallPurchaseInfo> findBySupplierId(String supplierId, Pageable pageable);

    /**
     * 保存采购信息
     * @param purchaseInfo
     * @return
     */
    String save(NewbeeMallPurchaseInfo purchaseInfo);


    // 列出信息
    PageResult getNewBeeMallPurchasePage(PageRequest pageRequest);


}
